#include <iostream>
#include "Server.hpp"

int main()
{
    Server server;
    std::cout << "pos1" << std::endl;
    server.OpenPipeForRead();
    std::cout << "pos2" << std::endl;

    std::string message;
    while (true)
    {
        int n = server.ReceivePipe(&message);
        if (n > 0)
        {
            std::cout << "client say# " << message << std::endl;
        }
        else
        {
            break;
        }
        std::cout << "pos3" << std::endl;
    }
    std::cout << "client quit, me too" << std::endl;
    server.ClosePipe();

    return 0;
}